home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / include / sys / syslog.h < prev    next >
C/C++ Source or Header  |  1989-07-18  |  3KB  |  81 lines

  1. /*
  2.  * Copyright (c) 1982, 1986 Regents of the University of California.
  3.  * All rights reserved.  The Berkeley software License Agreement
  4.  * specifies the terms and conditions for redistribution.
  5.  *
  6.  *    @(#)syslog.h    7.8 (Berkeley) 5/26/88
  7.  */
  8.  
  9. #ifndef _SYSLOG
  10. #define _SYSLOG
  11.  
  12. /*
  13.  *  Facility codes
  14.  */
  15.  
  16. #define LOG_KERN    (0<<3)    /* kernel messages */
  17. #define LOG_USER    (1<<3)    /* random user-level messages */
  18. #define LOG_MAIL    (2<<3)    /* mail system */
  19. #define LOG_DAEMON    (3<<3)    /* system daemons */
  20. #define LOG_AUTH    (4<<3)    /* security/authorization messages */
  21. #define LOG_SYSLOG    (5<<3)    /* messages generated internally by syslogd */
  22. #define LOG_LPR        (6<<3)    /* line printer subsystem */
  23. #define LOG_NEWS    (7<<3)    /* network news subsystem */
  24. #define LOG_UUCP    (8<<3)    /* UUCP subsystem */
  25.     /* other codes through 15 reserved for system use */
  26. #define LOG_LOCAL0    (16<<3)    /* reserved for local use */
  27. #define LOG_LOCAL1    (17<<3)    /* reserved for local use */
  28. #define LOG_LOCAL2    (18<<3)    /* reserved for local use */
  29. #define LOG_LOCAL3    (19<<3)    /* reserved for local use */
  30. #define LOG_LOCAL4    (20<<3)    /* reserved for local use */
  31. #define LOG_LOCAL5    (21<<3)    /* reserved for local use */
  32. #define LOG_LOCAL6    (22<<3)    /* reserved for local use */
  33. #define LOG_LOCAL7    (23<<3)    /* reserved for local use */
  34.  
  35. #define LOG_NFACILITIES    24    /* maximum number of facilities */
  36. #define LOG_FACMASK    0x03f8    /* mask to extract facility part */
  37.  
  38. #define LOG_FAC(p)    (((p) & LOG_FACMASK) >> 3)    /* facility of pri */
  39.  
  40. /*
  41.  *  Priorities (these are ordered)
  42.  */
  43.  
  44. #define LOG_EMERG    0    /* system is unusable */
  45. #define LOG_ALERT    1    /* action must be taken immediately */
  46. #define LOG_CRIT    2    /* critical conditions */
  47. #define LOG_ERR        3    /* error conditions */
  48. #define LOG_WARNING    4    /* warning conditions */
  49. #define LOG_NOTICE    5    /* normal but signification condition */
  50. #define LOG_INFO    6    /* informational */
  51. #define LOG_DEBUG    7    /* debug-level messages */
  52.  
  53. #define LOG_PRIMASK    0x0007    /* mask to extract priority part (internal) */
  54. #define LOG_PRI(p)    ((p) & LOG_PRIMASK)    /* extract priority */
  55.  
  56. #define    LOG_MAKEPRI(fac, pri)    (((fac) << 3) | (pri))
  57.  
  58. #ifdef KERNEL
  59. #define LOG_PRINTF    -1    /* pseudo-priority to indicate use of printf */
  60. #endif
  61.  
  62. /*
  63.  * arguments to setlogmask.
  64.  */
  65. #define    LOG_MASK(pri)    (1 << (pri))        /* mask for one priority */
  66. #define    LOG_UPTO(pri)    ((1 << ((pri)+1)) - 1)    /* all priorities through pri */
  67.  
  68. /*
  69.  *  Option flags for openlog.
  70.  *
  71.  *    LOG_ODELAY no longer does anything; LOG_NDELAY is the
  72.  *    inverse of what it used to be.
  73.  */
  74. #define    LOG_PID        0x01    /* log the pid with each message */
  75. #define    LOG_CONS    0x02    /* log on the console if errors in sending */
  76. #define    LOG_ODELAY    0x04    /* delay open until first syslog() (default) */
  77. #define LOG_NDELAY    0x08    /* don't delay open */
  78. #define LOG_NOWAIT    0x10    /* if forking to log on console, don't wait() */
  79.  
  80. #endif /* _SYSLOG */
  81.